package org.xy.yq.dao.impl;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.xy.yq.dao.IProvince;
import org.xy.yq.entity.Province;

import java.util.List;

@Repository("provinceImpl")
public class ProvinceImpl implements IProvince {
    @Autowired
    private SqlSessionTemplate sqlSessionTemplate;
    @Override
    public void insertProvince(Province province) {
        System.out.println("进来了"+sqlSessionTemplate+","+province);
        sqlSessionTemplate.getMapper(IProvince.class).insertProvince(province);
    }

    @Override
    public List<Province> selectAll() {
        return sqlSessionTemplate.getMapper(IProvince.class).selectAll();
    }

    @Override
    public List<Province> top5() {
        return sqlSessionTemplate.getMapper(IProvince.class).top5();
    }
}
